<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highsecondary" content="no">
    <meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width">

    <title>询价列表 -供方报名</title>
    <link href="../lib/fonts/material-icons.css?family=Material+Icons" rel="stylesheet">
    <link href="../lib/css/animate.min.css" rel="stylesheet">
    <link href="../lib/css/quasar.mat.rtl.min.css" rel="stylesheet" type="text/css">
    <style>
      [v-cloak] { display: none }
      div.q-field-vertical .q-field-label+.q-field-content { padding-top: 0!important }
      .search-group-left { font-size: 13px; border: 1px solid #ccc; padding: 3px 6px!important; border-radius: 3px 0 0 3px; border-right: none }
      .search-group-right { font-size: 13px;border: 1px solid #ccc; padding: 3px 6px!important; border-radius: 0 3px 3px 0 }
    </style>
  </head>
  <body>
    <div id="q-rfxVendorSignUp" v-cloak>
      <q-layout>
        <q-page-container>
          <q-card class="bg-white full-width">
              <q-card-main class="relative-position" >
                <q-tabs
                  align="left"
                  v-model="selectedTab"
                  :two-lines="false"
                  inverted
                  color="primary"
                  @select="">
                  <q-tab slot="title" name="tab-1" label="基本信息" ></q-tab>
                  <q-tab slot="title" name="tab-2" label="行项目" ></q-tab>
                  <q-tab slot="title" name="tab-3" label="询价附件" ></q-tab>
                  <q-tab-pane name="tab-1">
                    <div class="row justify-end q-px-md">
                      <q-btn
                              push
                              color="primary"
                              @click="signUpOrRefuseClick(1)"
                              v-if="baseInfoForm.signUpStatus==0"
                              label="报名"
                              class="q-mt-sm q-mr-sm q-pa-sm"></q-btn>
                      <q-btn
                              push
                              color="primary"
                              @click="refuseModal()"
                              label="拒绝"
                              v-if="baseInfoForm.signUpStatus==0"
                              class="q-mt-sm q-mr-sm q-pa-sm"></q-btn>
                    </div>
                    <div class="row justify-between q-pa-sm position-relative">
                      <div style="width: 85%" >
                        <p class="q-ml-md row gutter-x-sm">
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        询价主题：
                        <span class="text-light">{{baseInfoForm.title}}</span>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        询价类型：
                        <span class="text-light" v-if="baseInfoForm.type==1">project - 项目</span>
                        <span class="text-light" v-if="baseInfoForm.type==2">price-调价</span>
                        <span class="text-light" v-if="baseInfoForm.type==3">PCN -产品变更</span>
                        <span class="text-light" v-if="baseInfoForm.type==4">ECN-工程变更</span>
                        <span class="text-light" v-if="baseInfoForm.type==5">Supplier 供方变更</span>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        密封报价：
                        <q-chip v-if="baseInfoForm.isSeal==1" dense square color="positive">是</q-chip>
                        <q-chip v-if="baseInfoForm.isSeal==0" dense square color="light">否</q-chip>
                      </span>
                        </p>
                        <p class="q-ml-md row gutter-x-sm">
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        采购组织：
                        <span class="text-light">{{baseInfoForm.purOrgName}}</span>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        采购组：
                        <span class="text-light">{{baseInfoForm.purGroupName}}</span>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        采购执行人：
                        <span class="text-light">
                          {{baseInfoForm.purExecutorName}}
                        </span>
                      </span>
                        </p>
                        <p class="q-ml-md row gutter-x-sm">
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        需要报名：
                        <q-chip v-if="baseInfoForm.isSignUp==1" dense square color="positive">是</q-chip>
                        <q-chip v-if="baseInfoForm.isSignUp==0" dense square color="light">否</q-chip>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        报名开始时间：
                        <span class="text-light">{{baseInfoForm.signUpStartTime}}</span>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        报名结束时间：
                        <span class="text-light">
                          {{baseInfoForm.signUpEndTime}}
                        </span>
                      </span>
                        </p>
                        <p class="q-ml-md row gutter-x-sm">
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        报价开始时间：
                        <span class="text-light">{{baseInfoForm.quoteStartTime}}</span>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        报价结束时间：
                        <span class="text-light">{{baseInfoForm.quoteEndTime}}</span>
                      </span>
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        允许报价修改次数：
                        <q-chip dense color="positive" square>
                          {{baseInfoForm.quoteModifyTimes}}
                        </q-chip>
                      </span>
                        </p>
                        <p class="q-ml-md row gutter-x-sm">
                      <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        是否TR：
                        <q-chip v-if="baseInfoForm.isTr==1" dense square color="positive">是</q-chip>
                        <q-chip v-if="baseInfoForm.isTr==0" dense square color="light">否</q-chip>
                      </span>
                      <span v-if="baseInfoForm.isTr==1" class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        TR文件：
                        <span class="text-light"><a :href="downloadUrl" target="_blank" style="text-decoration: none;">点击下载</a></span>
                      </span>
                      <span v-if="baseInfoForm.isTr==1" class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                        TR评审书：
                          <q-uploader
                            style="display:inline-block;width:180px"
                            ref="businessLic1"
                            color="secondary"
                            name="files"
                            @uploaded="uploaded"
                            hide-upload-button
                            @add="$refs['businessLic1'].upload()"
                            :headers="{'Accept': 'application/json;charset=utf-8'}"
                            :url="uploadUrl" ></q-uploader>
                      </span>
                       <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                         报价说明:
                         <span class="text-light"> {{baseInfoForm.remark}}</span>
                      </span>
                        </p>
                      </div>
                    </div>
                  </q-tab-pane>
                  <q-tab-pane name="tab-2">
                    <div class="row justify-end">
                      <q-input
                        class="search-group-left"
                        hide-underline
                        placeholder="输入编码"
                        v-model.trim="searchForm.value"></q-input>
                      <q-select
                        class="search-group-right"
                        hide-underline
                        radio
                        :options="[{ label:'编码', value: 'matCode' }]"
                        v-model="searchForm.key"></q-select>
                      <q-btn
                        size="sm"
                        color="primary"
                        :loading="btnLoadingSearch"
                        @click="searchDetails"
                        class="q-ml-sm q-pa-sm">
                        <span slot="loading">
                          <q-spinner-hourglass></q-spinner-hourglass>
                          搜索中
                        </span>
                        <q-icon name="search"></q-icon>
                        <span>{{ $t('查询') }}</span>
                      </q-btn>
                      <q-btn
                        size="sm"
                        color="secondary"
                        @click="resetDetails"
                        :loading="btnLoadingReset"
                        class="q-ml-sm q-pa-sm">
                        <span slot="loading">
                          <q-spinner-hourglass></q-spinner-hourglass>
                          重置中
                        </span>
                        <q-icon name="refresh" ></q-icon>
                        <span>{{ $t('重置') }}</span>
                      </q-btn>
                    </div>
                    <q-table
                            class="no-shadow"
                            :data="tableData"
                            dense
                            hide-bottom
                            :columns="columnsOne"
                            :rows-per-page-options="[5, 10, 20]"
                            selection="multiple"
                            :loading="listLoading"
                            :selected.sync="selectedOne"
                            :pagination.sync="serverPagination"
                            @request="listGet"
                            row-key="id"
                    >
                      <template slot="body" slot-scope="props">
                        <q-tr
                                :props="props"
                        >
                          <q-td >
                            <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                          </q-td>
                          <q-td key="matName" :props="props" >
                            {{props.row.matName }}
                          </q-td>
                          <q-td key="matCode" :props="props" >
                            {{props.row.matCode }}
                          </q-td>
                          <q-td key="matPictureCode" :props="props" >
                            {{props.row.matPictureCode }}
                          </q-td>
                          <q-td key="matCategoryName" :props="props" >
                            {{props.row.matCategoryName }}
                          </q-td>
                          <q-td key="quantity" :props="props" >
                            {{props.row.quantity }}
                          </q-td>
                          <q-td key="unitName" :props="props" >
                            {{props.row.unitName }}
                          </q-td>
                          <q-td key="currencyName" :props="props" >
                            {{props.row.currencyName }}
                          </q-td>
                          <q-td key="quoteTempName" :props="props" >
                            {{props.row.quoteTempName }}
                          </q-td>
                          <q-td key="isMoldCostShare" :props="props" >
                            <q-chip v-if="props.row.isMoldCostShare == 1" dense square color="positive">是</q-chip>
                            <q-chip v-if="props.row.isMoldCostShare == 0" dense square color="light">否</q-chip>
                          </q-td>
                        </q-tr>
                      </template>
                    </q-table>
                    <div class="row justify-end items-center text-faded">
                      每页的行数：
                      <q-select
                              :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]"
                              hide-underline
                              class="q-mr-md"
                              v-model="serverPagination.rowsPerPage"></q-select>
                      第
                      <q-pagination
                              class="q-mt-xs"
                              v-model="serverPagination.page"
                              input
                              boundary-links
                              direction-links
                              :max-pages="5"
                              :ellipses="true"
                              :max="pages"></q-pagination>
                      页 &nbsp; 共 {{ total }} 条
                    </div>
                  </q-tab-pane>
                  <q-tab-pane name="tab-3">
                    <q-table
                            class="no-shadow"
                            :data="tableDataTwo"
                            dense
                            hide-bottom
                            :columns="columnsTwo"
                            :rows-per-page-options="[5, 10, 20]"
                            selection="multiple"
                            :loading="listLoadingTwo"
                            :selected.sync="selectedTwo"
                            :pagination.sync="serverPaginationTwo"
                            @request="listGetTwo"
                            row-key="id"
                    >
                      <template slot="body" slot-scope="props">
                        <q-tr :props="props" >
                          <q-td >
                            <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                          </q-td>
                          <q-td key="action" :props="props" >
                            <q-btn
                                    flat
                                    color="primary"
                                    class="q-pa-none"
                                    @click="downloadFile(props.row.id)">
                              {{ '下载' }}
                            </q-btn>
                          </q-td>
                          <q-td key="fileName" :props="props" >
                            <q-btn
                                    flat
                                    color="primary"
                                    class="q-pa-none">
                              {{ props.row.fileName }}
                            </q-btn>
                          </q-td>
                          <q-td key="suffix" :props="props" >
                            {{ props.row.suffix }}
                          </q-td>
                          <q-td key="updateUserName" :props="props" >
                            {{ props.row.updateUserName }}
                          </q-td>
                          <q-td key="lastUpdateTime" :props="props" >
                            {{ props.row.lastUpdateTime }}
                          </q-td>
                          <q-td key="remark" :props="props" >
                            {{ props.row.remark }}
                          </q-td>
                        </q-tr>
                      </template>
                    </q-table>
                    <div class="row justify-end items-center text-faded">
                      每页的行数：
                      <q-select
                              :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]"
                              hide-underline
                              class="q-mr-md"
                              v-model="serverPaginationTwo.rowsPerPage"></q-select>
                      第
                      <q-pagination
                              class="q-mt-xs"
                              v-model="serverPaginationTwo.page"
                              input
                              boundary-links
                              direction-links
                              :max-pages="5"
                              :ellipses="true"
                              :max="pagesTwo"></q-pagination>
                      页 &nbsp; 共 {{ totalTwo }} 条
                    </div>
                  </q-tab-pane>
                 </q-tabs>
                <q-inner-loading :visible="visible">
                  <q-spinner-gears size="50px" color="primary"></q-spinner-gears>
                </q-inner-loading>
              </q-card-main>
          </q-card>
          <q-page-sticky position="top-right" :offset="[32,20]">
            <q-fab
                    color="primary"
                    icon="keyboard_arrow_down"
                    direction="down"
            >
              <q-fab-action
                      color="secondary"
                      @click="back()"
                      icon="arrow_back">
                <q-tooltip anchor="center left" self="center right" :offset="[10, 10]">返回</q-tooltip>
              </q-fab-action>
            </q-fab>
          </q-page-sticky>
        </q-page-container>
        </q-layout>
      <q-modal no-backdrop-dismiss v-model="refuseEditModal" :content-css="{minWidth: '35vw', minHeight: '300px',borderRadius: '4px'}">
        <q-modal-layout>
          <q-toolbar slot="header" color="white">
            <q-toolbar-title class="text-dark">
              {{ '驳回原因'  }}
            </q-toolbar-title>
            <q-btn flat @click="refuseEditModal = false">
              <q-icon name="close" color="dark"></q-icon>
            </q-btn>
          </q-toolbar>
          <q-card class="q-px-md q-py-sm bg-white no-shadow full-width">
            <q-card-main class="row gutter-xs">
               <q-field
                      :error="$v.refuseForm.listName.$error"
                      error-label="该字段为必填项"
                      class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <q-input
                        :float-label="$t('驳回原因')"
                        @blur="$v.refuseForm.listName.$touch"
                        v-model="refuseForm.listName"></q-input>
              </q-field>
            </q-card-main>
          </q-card>
          <q-toolbar slot="footer" color="white" class="row justify-end">
            <q-btn
                    flat
                    color="primary"
                    @click="refuseEditModal = false">{{$t("取消")}}</q-btn>
            <q-btn
                    flat
                    :loading="btnLoading"
                    color="primary"
                    @click="signUpOrRefuseClick(-1)">{{$t("保存")}}</q-btn>
          </q-toolbar>
        </q-modal-layout>
      </q-modal>
    </div>

    <!-- ie-polyfill 、 vue.js and quasar-framework -->
    <script src="../lib/js/quasar.ie.polyfills.umd.min.js"></script>
    <script src="../lib/js/vue.js"></script>
    <script src="../lib/js/quasar.mat.umd.min.js"></script>
    <!-- babel for es6 transform -->
    <!-- <script src="lib/js/babel.min.js"></script> -->
    <!-- vue validate -->
    <script src="../lib/js/vuelidate.min.js"></script>
    <script src="../lib/js/validators.min.js"></script>
    <!-- consts and utils ps: always leave this file first -->
    <script src="../script/consts.js"></script>
    <script src="../script/utils.js"></script>
    <!-- status code -->
    <script src="../script/status.code.js"></script>
    <!-- qs for axios -->
    <script src="../lib/js/qs.min.js"></script>
    <!-- axios for http request -->
    <script src="../lib/js/axios.js"></script>
    <!-- axios.instance must be after axios -->
    <script src="../script/axios.instance2.js"></script>
    <!-- quasar i18n zh-hans -->
    <script src="../lib/lang/zh-hans.js"></script>
    <!-- vue-i18n for application's internationalization -->
    <script src="../lib/js/vue-i18n.js"></script>
    <!-- current page international file -->
    <script src="../lang/sor/rfxPurAdd.js"></script>

    <script>
			// quasar components use
            Vue.use(window.vuelidate.default)
            var minLength = window.validators.minLength
            var required = window.validators.required
      Quasar.i18n.set(Quasar.i18n[LANGUGE])
			new Vue({
        el: '#q-rfxVendorSignUp',
        i18n: i18n,
		data: function() {
			return {
             mainTab: 'mainInfo',
             selectedTab: 'tab-1',
              // loadings
              visible:false,
              btnLoadingSearch: false,
              btnLoadingReset: false,

             uploadUrl: baseURL + '/manager/rfq/file/upload/TR_BACK',
             tableData: [],
             tableDataTwo: [],
             selectedOne: [],
             selectedTwo: [],
             serverPagination: {
                 page: 1,
                 rowsPerPage: 5,
                 rowsNumber: 5
              },
               total: 0,
               serverPaginationTwo: {
                 page: 1,
                 rowsPerPage: 5,
                 rowsNumber: 5
                },
                totalTwo: 0,
             searchForm: {
                key: 'matCode',
                value: ''
             },
             btnLoading: false,
             refuseEditModal: false,
              refuseForm: {
                listName: ''
              },
             downloadUrl: '', // 下载地址
             baseInfoForm: {
                   title:'',
                   type:'',
                   isSeal:'',
                   purOrgName:'',
                   purGroupName:'',
                   purExecutorName:'',
                   isSignUp:'',
                   signUpStartTime:'',
                   signUpEndTime:'',
                   quoteStartTime:'',
                   quoteEndTime:'',
                   quoteModifyTimes:'',
                   isTr:'',
                   remark:'',
                   signUpStatus:'',
             },
            // 通用
            addOrEdit: 1, // 1 新增 2 编辑
            disable: true,
            trFileId:0,
          }
				},
              validations: {
                refuseForm: {
                  listName: { required: required }
                }
              },
				computed: {
                  columnsOne: function() {
                    return [
                      {
                        name: 'matName',
                        label: '零件名称',
                        align: 'center'
                      },
                      {
                        name: 'matCode',
                        label: '零件编码',
                        align: 'center'
                      },
                      {
                        name: 'matPictureCode',
                        label: '零件图号',
                        align: 'center'
                      },
                      {
                        name: 'matCategoryName',
                        label: '品类',
                        align: 'center'
                      },
                      {
                        name: 'quantity',
                        label: '数量',
                        align: 'center'
                      },
                      {
                        name: 'unitName',
                        label: '价格单位',
                        align: 'center'
                      },
                      {
                        name: 'currencyName',
                        label: '币种',
                        align: 'center'
                      },
                      {
                        name: 'quoteTempName',
                        label: '报价模板',
                        align: 'center'
                      },
                      {
                        name: 'isMoldCostShare',
                        label: '模具摊销',
                        align: 'center'
                      }
                    ]
                  },
                  columnsTwo: function() {
                    return [
                      {
                        name: 'action',
                        label: this.$t('操作'),
                        align: 'center'
                      },
                      {
                        name: 'fileName',
                        label: '文件名称',
                        align: 'center'
                      },
                      {
                        name: 'suffix',
                        label: '格式',
                        align: 'center'
                      },
                      {
                        name: 'updateUserName',
                        label: '修改人',
                        align: 'center'
                      },
                      {
                        name: 'lastUpdateTime',
                        label: '修改时间',
                        align: 'center'
                      },
                      {
                        name: 'remark',
                        label: '说明',
                        align: 'center'
                      },
                    ]
                  },
                  pages: function() {
                    return Math.ceil(this.total/this.serverPagination.rowsPerPage)
                  }
                  ,
                  pagesTwo: function() {
                    return Math.ceil(this.totalTwo/this.serverPaginationTwo.rowsPerPage)
                  }
        },
        watch: {
          'serverPagination.page': function(rowsPerPage) {
            this.listGet({ pagination: this.serverPagination })
          },
          'serverPagination.rowsPerPage': function(rowsPerPage) {
            this.listGet({ pagination: this.serverPagination })
          },
          'serverPaginationTwo.page': function(rowsPerPage) {
            this.listGetTwo({ pagination: this.serverPaginationTwo })
          },
          'serverPaginationTwo.rowsPerPage': function(rowsPerPage) {
            this.listGetTwo({ pagination: this.serverPaginationTwo })
          }
        },
        created: function() {
          this.listGet({
            pagination: this.serverPagination
          }),
           this.listGetTwo({
             pagination: this.serverPaginationTwo
            }),
          this.signUp()
        },
		methods: {
          listGet: function(arg) {
            var args = GetRequest();
            var that = this
            this.listLoading = true
            this.serverPagination = arg.pagination
            axios({
              method: 'post',
              url: '/manager/rfq/item/query',
              data: {
                page: this.serverPagination.page,
                rows: this.serverPagination.rowsPerPage,
                sort: this.serverPagination.sortBy,
                order: this.serverPagination.descending == true? 'desc' : (this.serverPagination.descending == false? 'asc' : null),
                // 'search_LIKE_matCode': this.searchForm.search_LIKE_matCode,
                search_LIKE_matCode: this.searchForm.key == 'matCode'? this.searchForm.value: '',
                'search_EQ_rfqHeaderEntity.id': args.headerId,
              }
            })
            .then(function(data) {
              that.tableData = data.rows
              that.total = data.total
              that.listLoading = false
              that.btnLoadingSearch = false
              that.btnLoadingReset = false
            })
            .catch(function(err) {
              console.log(err)
            })
          },
          // 明细 查询
          searchDetails: function() {
            this.btnLoadingSearch = true
            this.listGet({
              pagination: this.serverPagination
            })
          },
          resetDetails: function() {
            this.btnLoadingReset = true
            this.searchForm = {  
              value: '',
              key: 'matCode'
            }
            this.listGet({
              pagination: this.serverPagination
            })
          },
          listGetTwo: function(arg) {
            var args = GetRequest();
            var that = this
            this.listLoadingTwo = true
            this.visible=true
            this.serverPaginationTwo = arg.pagination
            axios({
              method: 'post',
              url: '/manager/rfq/file/query',
              data: {
                page: this.serverPaginationTwo.page,
                rows: this.serverPaginationTwo.rowsPerPage,
                sort: this.serverPaginationTwo.sortBy,
                order: this.serverPaginationTwo.descending == true? 'desc' : (this.serverPaginationTwo.descending == false? 'asc' : null),
               'search_EQ_busId': args.headerId,
              }
            })
                    .then(function(data) {
                      that.tableDataTwo = data.rows
                      that.totalTwo = data.total
                      that.listLoadingTwo = false
                      that.visible=false
                    })
                    .catch(function(err) {
                      console.log(err)
                    })
          },
          back:function () {
            window.location.href = 'rfxVendorList.html'
          },
          signUp:function () {
            var args = GetRequest();
            var that = this;
            axios({
              method: 'post',
              url: '/manager/rfqvendor/main/getInfo/'+args.id
            })
                    .then(function(data) {
                      that.baseInfoForm = {
                        title:data.data.rfqHeaderEntity.title,
                        type:data.data.rfqHeaderEntity.type,
                        isSeal:data.data.rfqHeaderEntity.isSeal,
                        purOrgName:data.data.rfqHeaderEntity.purOrgName,
                        purGroupName:data.data.rfqHeaderEntity.purGroupName,
                        purExecutorName:data.data.rfqHeaderEntity.purExecutorName,
                        isSignUp:data.data.rfqHeaderEntity.isSignUp,
                        signUpStartTime:data.data.rfqHeaderEntity.signUpStartTime,
                        signUpEndTime:data.data.rfqHeaderEntity.signUpEndTime,
                        quoteStartTime:data.data.rfqHeaderEntity.quoteStartTime,
                        quoteEndTime:data.data.rfqHeaderEntity.quoteEndTime,
                        quoteModifyTimes:data.data.rfqHeaderEntity.quoteModifyTimes,
                        isTr:data.data.rfqHeaderEntity.isTr,
                        signUpStatus:data.data.signUpStatus,
                        remark:data.data.remark
                      }
                      that.downloadUrl = baseURL + '/manager/rfq/file/download/'+data.data.trFileId
                    })
                    .catch(function(err) {
                      console.log(err)
                    })
          },
          signUpOrRefuseClick:function (type) {
            if(type==1){
              if(this.baseInfoForm.isTr==1){
                if(this.trFileId==0){
                  this.$q.notify({
                    message: '请先上传TR评审书',
                    type: 'warning',
                    icon: 'warning',
                    timeout: 1000,
                    position: 'top-right'
                  })
                  return;
                }
              }
              this.btnLoading = true;
              var args = GetRequest();
              var that = this;
              axios({
                method: 'post',
                url: '/manager/rfqvendor/main/signUp',
                data: {
                  id: args.id,
                  signUpStatus: type,
                  trFileId:this.trFileId
                }
              })
              .then(function(data) {
                if (data.success) {
                  that.$q.notify({
                    message: '操作成功',
                    type: 'positive',
                    icon: 'done',
                    timeout: 1000,
                    position: 'top-right'
                  })
                  setTimeout(function() {
                    window.location.href = 'rfxVendorQuotedPrice.html?headerId='+args.headerId+'&id='+args.id
                  }, 1000);
                } else {
                  that.$q.notify({
                    message: data.msg,
                    type: 'negative',
                    icon: 'error_outline',
                    timeout: 1000,
                    position: 'top-right'
                  })
                }
                that.btnLoading = false
                if(data.success==true){
                }

              })
              .catch(function(err) {
                console.log(err)
              })
            }else {
              this.$v.refuseForm.$touch();
              if (!this.$v.refuseForm.$error) {
                this.btnLoading = true;
                var args = GetRequest();
                var that = this;
                axios({
                  method: 'post',
                  url: '/manager/rfqvendor/main/signUp',
                  data: {
                    id: args.id,
                    signUpStatus: type,
                    rejectReason:this.refuseForm.listName,
                    remark:this.baseInfoForm.remark
                  }
                })
                        .then(function(data) {
                          that.btnLoading = false
                          //that.refuseEditModal = false
                          if(data.success==true){
                            window.location.href = 'rfxVendorList.html'
                          }
                        })
                        .catch(function(err) {
                          console.log(err)
                        })
              }
            }
          },
          refuseModal: function () {
            this.refuseForm = {
              listName: ''
            }
            this.refuseEditModal = true
          },
          downloadFile:function (fileId) {
            window.location.href = baseURL +'/manager/rfq/file/download/'+fileId
          },
          // 文件上传完成
          uploaded: function(file, xhr) {
            var _fileRes = JSON.parse(xhr.response)
            var that = this;
            that.trFileId=_fileRes.data
          }
        }
	})
    </script>
  </body>
</html>